package com.medical.doctor.service.impl;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.medical.common.utils.PageUtils;
import com.medical.common.utils.Query;

import com.medical.doctor.dao.DoctorHospitalDao;
import com.medical.doctor.entity.DoctorHospitalEntity;
import com.medical.doctor.service.DoctorHospitalService;


@Service("doctorHospitalService")
public class DoctorHospitalServiceImpl extends ServiceImpl<DoctorHospitalDao, DoctorHospitalEntity> implements DoctorHospitalService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String hospitalName = (String) params.get("hospitalName");
        QueryWrapper<DoctorHospitalEntity> wrapper = new QueryWrapper<>();
        if(hospitalName!=null&&!hospitalName.equals("")){
            wrapper.like("hospital_name",hospitalName);
        }
        IPage<DoctorHospitalEntity> page = this.page(
                new Query<DoctorHospitalEntity>().getPage(params),
                wrapper
        );

        return new PageUtils(page);
    }

}